#ifndef FUNCTIONTRANSFER_H
#define FUNCTIONTRANSFER_H

#include <QObject>
#include <functional>

class FunctionTransfer : public QObject
{
Q_OBJECT

public:
    explicit FunctionTransfer(QObject *parent = 0);// 构造函数
    static void execinmain(std::function<void()> f); //制定函数f在main中执行

signals:
    void comming(std::function<void()> f);//在别的线程有函数对象传来

public slots:
    void exec(std::function<void()> f); //执行函数对象
};


#endif // FUNCTIONTRANSFER_H
